App.controller('myUnpayOrdersController', ['$rootScope', '$scope', '$state', '$window', 'Page',function($rootScope, $scope, $state, $window, Page) {
		
	$scope.orderList = [];
	
	$scope.searchOrder = function(){
		Page.ajaxPost('app/order/toBePaid.do',null, function(resp) {
			$scope.orderList = resp.data;
		});
	};
	
	$scope.cancelOrder = function(order){
		Page.confirm('您确认取消该订单?',function(){
			Page.ajaxPost('order/cancel.do',{orderId : order.orderId}, function(resp) {
				$scope.searchOrder();
			});
		});
	};
	
	$scope.viewOrder = function(order){
		$state.go("user.order",{orderId: order.orderId});
	};
	
	$scope.payNow = function(order) {
		$state.go("user.order",{orderId: order.orderId});
	};
	
	$scope.searchOrder();
	
}]);